package iterator.collegeDisplay;

import iterator.collegeDisplay.aggregate.college.ComputerCollege;
import iterator.collegeDisplay.aggregate.college.InfoCollege;
import iterator.collegeDisplay.aggregate.college.base.College;

import java.util.Iterator;

public class Client {

    public static void main(String[] args) {

        College computerCollege = new ComputerCollege();
        computerCollege.addDepartment("Java","Java");
        computerCollege.addDepartment("Python","Python");
        computerCollege.addDepartment("Golang","Golang");

        Iterator computerCollegeIterator = computerCollege.createIterator();

        while (computerCollegeIterator.hasNext()) {
            System.out.println(computerCollegeIterator.next());
        }

        System.out.println("=====================================");

        College infoCollege = new InfoCollege();
        infoCollege.addDepartment("Net","Net");
        infoCollege.addDepartment("Saf","Saf");

        Iterator infoCollegeIterator = infoCollege.createIterator();

        while (infoCollegeIterator.hasNext()) {
            System.out.println(infoCollegeIterator.next());
        }

    }

}
